//
//  UIButton+Config.h
//  LSControl
//
//  Created by Beyondream on 2018/5/9.
//  Copyright © 2018年 Beyondream. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN
typedef void(^ActionHandle)(void);
typedef void(^ActionParamHandle)(UIButton * sender);

@interface UIButton (Config)

/**
 button type
 */
+ (UIButton *(^)(UIButtonType buttonType))byd_buttonType;

/**
 default is UIEdgeInsetsZero.
 */
- (UIButton * (^)(UIEdgeInsets contentEdgeInsets))byd_contentEdgeInsets;

/**
  default is UIEdgeInsetsZero
 */
- (UIButton * (^)(UIEdgeInsets titleEdgeInsets))byd_titleEdgeInsets;

/**
 default is UIEdgeInsetsZero
 */
- (UIButton * (^)(UIEdgeInsets imageEdgeInsets))byd_imageEdgeInsets;

/**
 default is YES. if YES, image is drawn darker when highlighted(pressed)
 */
- (UIButton * (^)(BOOL  adjustsImageWhenHighlighted))byd_adjustsImageWhenHighlighted;


/**
 default is YES. if YES, image is drawn lighter when disabled
 */
- (UIButton * (^)(BOOL  adjustsImageWhenDisabled))byd_adjustsImageWhenDisabled;

/**
  default is NO. if YES, show a simple
 */
- (UIButton * (^)(BOOL  showsTouchWhenHighlighted))byd_showsTouchWhenHighlighted;


/**
 The tintColor is inherited through the superview hierarchy. See UIView for more information
 */
- (UIButton * (^)(UIColor *tintColor))byd_tintColor;
/**
 default is nil. title is assumed to be single line
 */
- (UIButton * (^)(NSString * title , UIControlState state))byd_title;
/**
 default is nil. use 50% black
 */
- (UIButton * (^)(UIColor * titleShadowColor , UIControlState state))byd_titleShadowColor;

/**
 
 */
- (UIButton * (^)(UIColor * textColor , UIControlState state))byd_titleColor;

/**
  default is nil. should be same size if different for different states
 */
- (UIButton * (^)(UIImage * image , UIControlState state))byd_image;

/**
 default is nil
 */
- (UIButton * (^)(UIImage * image , UIControlState state))byd_backgroundImage;
/**
 default is nil. title is assumed to be single line
 */
- (UIButton * (^)(NSAttributedString * title ,UIControlState state))byd_attributedTitle;

/**
 default is 17.
 */
- (UIButton * (^)(UIFont *font))byd_titleFont;

/**
 tag 
 */
- (UIButton * (^)(NSInteger tag))byd_tag;

/**
 default is white.
 */
- (UIButton * (^)(UIColor * backgroundColor))byd_backgroundColor;

- (UIButton * (^)(CGFloat cornerRadius))byd_cornerRadius;

- (UIButton * (^)(CGFloat borderWidth))byd_borderWidth;

- (UIButton * (^)(UIColor * borderColor))byd_borderColor;

/**
 reset button Subviews
 */
- (UIButton * (^)(CGFloat space))titleOverImage;
- (UIButton * (^)(CGFloat space))titleBelowImage;
- (UIButton * (^)(CGFloat space))imageOnTheTitleLeft;
- (UIButton * (^)(CGFloat space))imageOnTheTitleRight;
/**
 addActionHandle 无参数
 */
- (UIButton * (^)(UIControlEvents event,ActionHandle handle))byd_addActionHandle;


/**
 addActionHandle 有参数
 */
- (UIButton * (^)(UIControlEvents event,ActionParamHandle handle))byd_addParamActionHandle;

@end

NS_ASSUME_NONNULL_END









